<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://eureka.yigolden.net/stringutils/sutaglib/1.0" prefix="su"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>开始拍卖</title>
<!-- Attach our CSS -->
<link type="text/css" href="${staticResources}/css/startauction.css" rel="stylesheet" />	
<script type="text/javascript" src="${staticResources}/js/ajax.js"></script>
<!-- Attach necessary scripts -->
<!-- 
<script type="text/javascript" src="${staticResources}/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${staticResources}/js/jquery.reveal.js"></script>
 -->
<style type="text/css">
body { font-family: "HelveticaNeue","Helvetica-Neue", "Helvetica", "Arial", sans-serif; }
.big-link { }
</style>
<script type="text/javascript">
function refreshcaptcha()
{
	var timenow = new Date().getTime();    
	var captcha = document.getElementById("imgverifycode").src = "${contextPath}/captcha?flag=stac&random="+timenow;
}

function startAuction() {
	var ctlStartingPrice = document.getElementById("startingPrice");
	var ctlMinimunMarkupPrice = document.getElementById("minimunMarkupPrice");
	var verifycode = document.getElementById("verifycode").value;
	var beid = document.getElementById("beid").value;
	
	var mode = "ajax";
	var params="beid=" + encodeURIComponent(beid);
	params+="&startingPrice="+encodeURIComponent(ctlStartingPrice.value);
	params+="&minimunMarkupPrice="+encodeURIComponent(ctlMinimunMarkupPrice.value);
	params+="&verifycode="+encodeURIComponent(verifycode);
	params+="&mode="+encodeURIComponent(mode);
	
	doAjax("StartAuction"
			,params,function(rst){
		var rst=eval('(' +rst+ ')');
		if(rst.status == 0) {
			parent.location.href = rst.redirectURL;
		} else  {
			document.getElementById("error").innerHTML = rst.message;
		}
	});
	
}
</script>
</head>
<body>
<form name="StartTransaction" action="StartTransaction" method="post" onsubmit="startAuction();return false;">

<div class="main">
  <div class="lmain"><img src="${contextPath}/Books/GetBookPicture?beid=${bookitem.beID}&size=min" style="max-width:180px; max-height:220px;" alt=""></div>
  <div class="rmain">
    <div class="book"> 
      <div class="name">书名：<b>${fn:escapeXml(bookitem.name) }</b></div>
      <small>版本：${fn:escapeXml(bookitem.version) }</small><br>
      <small>出版社：${fn:escapeXml(bookitem.publisher) }</small><br>
      <small>主编：${fn:escapeXml(bookitem.chiefEditor) }</small><br>
      <small>分类：${fn:escapeXml(bookitem.category.name) }</small><br>
      <div class="price">起拍价：<input type="text" id="startingPrice" value="${bookitem.price }" style="width:100px;" /></div>
      <div class="price">最小加价：<input type="text" id="minimunMarkupPrice" value="1" style="width:83px;" /></div>
    </div>
    <div class="yzm" style="margin-top:-20px;">验证码：<input type="text" id="verifycode" style="width:60px; height:20px;margin: -5px 0px 0px 0px;"/><img id="imgverifycode" src="${contextPath}/captcha?flag=stac" width="80" height="30" style="margin: 20px 0px 0px 0px; pading-top:20px;" alt=""><a href="#" onclick = "refreshcaptcha();return false;">换一张</a></div>
  </div>
</div>
<div class="botton">
  <div class="gm">
    <input type="image" style="" src="${staticResources}/image/startauction.gif" width="150" height="45" alt="" class="button" name="commit" value=""/>
  </div>
  <div class="error" id="error"></div>
  <div class="det">
    <label><input type="checkbox" name="checkbox" id="checkbox" />我已阅读并同意<a href="">相关文件</a></label>
  </div>
</div>

<input type="hidden" name="beid" id="beid" value="${bookitem.beID}" />
<input type="hidden" name="redirect_url" id="redirect_url" value="${su:encodeLink(param.redirect_url) }" />

</form>

</body>
</html>